from redis import StrictRedis

class UrlDuplicate(object):
    """
    duplicate url filter
    """
    def __init__(self, uri=None):
        print('redis_uri',uri)
        self.redis = StrictRedis.from_url(uri)

    def check(self, key, m_str):
        return self.redis.sadd(key, m_str)
